{% extends '@WebsiteBundle/layout/baselayout.html.twig' %}
{% import "@WebsiteBundle/macros/pagination.html.twig" as macros %}
{% block body_main %}
	{{ parent() }}
	<div class="page">
		{{ render(path('app_header', {"route":route})) }}
		<div class="page-wrapper">
			<div class="page-body">
				<div class="container-xl">
					<div class="row row-deck row-cards">
						<div class="col-lg-2">
							{{ render(path('app_user_userNav', {route:route})) }}
						</div>
						<div class="col-lg-10">
							<div class="card">
								{% if list %}
									<div class="card-header">
										<a href="{{ path('app_user_allmsg_read_do') }}" class="btn btn-normal btn-sm ajaxGet">全部标记为已读</a>
									</div>
								{% endif %}
								<div class="card-body">
									{% if list %}
										<div class="row row-deck row-cards">
											{% for l in list %}
												<div class="col-lg-12">
													<div class="d-flex flex-row mb-3">
														<div class="p-2 {% if l['status']==1 %} read {% endif %}">
															{% if l['uid']==0 %}
																<span class="badge bg-gray ">系统消息</span>&nbsp;&nbsp;&nbsp;&nbsp;
															{% endif %}
															{% if l['status']==0 %}
																<span class="layui-badge-dot"></span>
															{% endif %}
															{{ l['content']|raw }}</div>
														<div class="p-2">
															<span class="item">
																<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-alarm" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
																	<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
																	<path d="M12 13m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"></path>
																	<path d="M12 10l0 3l2 0"></path>
																	<path d="M7 4l-2.75 2"></path>
																	<path d="M17 4l2.75 2"></path>
																</svg>
																<span class="moment" data-time="{{ l['createdAtTime'] }}"></span>
															</span>
															{% if l['status']==0 %}
																<span class="item">
																	<a href="{{ path('app_user_msg_read_do', {id:l['id']}) }}" class="btn btn-primarybtn-sm ajaxGet">标记为已读</a>
																</span>
															{% endif %}
														</div>
													</div>
												</div>
											{% endfor %}
										</div>
										{{ macros.pagination(pagination) }}
									{% else %}
										{{ include('@WebsiteBundle/empty.html.twig',{msg:'数据为空!'}) }}
									{% endif %}

								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		{{ render(path('app_footer')) }}
	</div>
{% endblock %}
